package com.sxpi.technology_system.vo;


import lombok.Data;
import lombok.experimental.Accessors;

import java.util.HashMap;
import java.util.Map;

@Data
@Accessors(chain = true)
public class R {

    private Integer code;
    private String message;
    private Map<String, Object> data = new HashMap<>();

    public static com.sxpi.technology_system.vo.R ok(){
        com.sxpi.technology_system.vo.R r = new com.sxpi.technology_system.vo.R();
        r.setCode(0);
        r.setMessage("成功");
        return r;
    }

    public static com.sxpi.technology_system.vo.R error(){
        com.sxpi.technology_system.vo.R r = new com.sxpi.technology_system.vo.R();
        r.setCode(-1);
        r.setMessage("失败");
        return r;
    }

    public com.sxpi.technology_system.vo.R data(String rey, Object value){
        this.data.put(rey, value);
        return this;
    }

}
